//
//  CacheManager.h
//  CacheManager
//
//  Created by apple on 12-10-21.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface CacheManager : NSObject

@property (nonatomic, retain) NSMutableDictionary *dictinary;
//@property (nonatomic, retain) NSMutableDictionary *item;
//@property (nonatomic, retain) NSMutableData *connectionData;  

//@property (nonatomic, retain) NSURLConnection *connection; 
@property (nonatomic, retain) NSString  *directoryPath;


-(UIImage *) getImageFromURL:(NSString *)fileURL;
-(void)getDictinaryFromDB;

-(UIImage *)setImageFromURL:(NSString *)urlPath;
-(void) saveImage:(UIImage *)image withFileURL:(NSString *)FileURL;
-(UIImage *) loadImage:(NSString *)urlPath; //从本地获取图片

-(void) saveCacheDataToDB:(NSString*)url;

-(void)removeOverdueCache:(NSString*)removeURL;    //删除缓存
-(void)removeImageFromDisk:(NSString*)removeURL;   //从硬盘中删除图片

-(void)checkOverdueCache:(NSString*)Key; ;//检查过期缓存并自动删除
@end
